#!/usr/bin/env jython
# coding: utf-8

# Jython check
import sys
if not sys.platform.startswith('java'):
    raise ImportError("this 'setup.py' requires the jython interpreter")

# Standard Python Library
import os.path
import sys
from distutils.core import setup

# Java Standard Edition
import java.lang

args = sys.argv[1:]
if "install" in args:
    if not "--stdlib" in args:
        warning = "warning: the non-standard --stdlib option is implied"
        print >> sys.stderr, warning
    JYTHON_HOME = java.lang.System.getProperty("python.home")
    Lib = os.path.join(JYTHON_HOME, "Lib")
    javalib = os.path.join(JYTHON_HOME, "javalib")
    sys.argv[1:] = ["install", "--install-purelib", Lib,
                                "--install-data", javalib]

# TODO: long_description

setup(
    name="jython-elementtree",
    version="0.5.0",
    description="ElementTree for Jython",
    author="Sébastien Boisgérault",
    author_email="Sebastien.Boisgerault@gmail.com",
    url="http://code.google.com/p/jython-elementtree",
    license="MIT",
    py_modules=["pyexpat"],
    packages=["xml", "xml.etree", "xml.parsers"],
    data_files=[("", ["lib/xercesImpl.jar"])],
    platforms="Jython 2.5",
    classifiers=[
        "Development Status :: 4 - Beta",
        "Operating System :: OS Independent",
        "Topic :: Text Processing :: Markup :: XML",
        ]
    )
